/*
 * @Author: 一路向阳 tt_sunzhenfeng@163.com
 * @Date: 2024-02-13 21:09:10
 * @LastEditors: 一路向阳 tt_sunzhenfeng@163.com
 * @LastEditTime: 2024-02-13 21:11:31
 * @FilePath: \utils_react_manager\server\modules\admin.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
module.exports = () => {
  return async (ctx, next) => {
    if (ctx.state.user.username === 'admin') {
      next();
    }
    else {
      ctx.body = {
        code: -1,
        message: '不是admin，用户没权限'
      }
    }
  }
}